//*********************************************
//  This is Geant4 Template
//                                  author:Qian
//

#include "MyPrimaryGenerator.hh"
#include "G4Event.hh"
#include "G4GeneralParticleSource.hh"

#include "Verbose.hh"

//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......

MyPrimaryGenerator::MyPrimaryGenerator()
    : G4VUserPrimaryGeneratorAction()
{
    if (verbose)
        G4cout << "====>MyPrimaryGenerator::MyPrimaryGenerator()" << G4endl;

    m_GenPtr = MyGenContainer::GetInstance().GetMyGen();
}

//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......

MyPrimaryGenerator::~MyPrimaryGenerator()
{
}

//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......

void MyPrimaryGenerator::GeneratePrimaries(G4Event *anEvent)
{
    if (verbose)
        G4cout << "====>MyPrimaryGenerator::GeneratePrimaries()" << G4endl;

    m_GenPtr->GeneratePrimaryVertex(anEvent);
}
